package com.sac.approval.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sac.common.config.ApplicationContextRegister;
import com.sac.emp.dao.EmpDao;
import com.sac.emp.domain.Employee;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class DelegateMappingDO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	//
	private String userId;
	//
	private String agentUserId;

	private String agentInfo;
	//
	@JsonFormat(pattern = "yyyy/MM/dd", timezone="GMT+8")
	private Date startDate;
	//
	@JsonFormat(pattern = "yyyy/MM/dd", timezone="GMT+8")
	private Date endDate;
	//
	private String isEnabled;

	public String getAgentInfo() {
		EmpDao emp = ApplicationContextRegister.getBean(EmpDao.class);
		Employee employee = emp.getEmpDetailInfo(this.agentUserId);
		return employee.getEmpNm()+"/" + employee.getEmpJob();//+ "/" + employee.getEmpMail()
	}
}
